if (sessionStorage.uname) {
    $.get("../php/jc_person.php",`hide=findcollect`,data=>{
        console.log(data)
        data.forEach(obj=>{
            if(sessionStorage.uid==obj.userid){
                $(".collect-none").hide();
                $(".collect-list>ul").show();

                $(".collect-list>ul").append(`<li>
                    <div class='collect-action'>
                        <div class='collect-actzzc'></div>
                        <a href='javascript:void(0)' class='btn-cancel' onclick='delcollect(this)' id='${obj.id}'>取消收藏</a>
                    </div>
                    <a href='javascript:void(0)' class='colist-goodimg'>
                        <img src='${obj.img}' alt=''>
                    </a>
                    <p class='colist-name'>${obj.name}</p>
                    <div class='colist-pri clear_fix'>
                        <span class='fl colist-newpri'>￥${obj.newprice}</span>
                    </div>
                </li>`)
            }else{
                $(".collect-none").show();
                $(".collect-list>ul").hide();
            }
        })
    },"JSON")
}else{
    $(".collect-none").show();
    $(".collect-list>ul").hide();
}

function delcollect(btn){
    btn=$(btn);
    let id=btn.attr("id");
    $.get("../php/jc_person.php",`hide=delcollect&id=${id}`,data=>{
        console.log(data)
        if(data){
            btn.parent().parent().remove();
        }
    })
}